package com.example.opengl.render.cubemap

import com.alibaba.android.arouter.facade.annotation.Route
import com.android.baselibrary.base.BaseActivity
import com.example.opengl.R
import com.example.opengl.databinding.ActivityOpenglRenderCircleBinding
import com.example.opengl.main.OpenGLPath
import com.example.opengl.render.image.ImageDrawer
import com.example.opengl.render.triangle.TriangleRender

/**
 * @author: Mr.You
 * @create: 2023-08-07 14:59
 * @description: 立方体贴图
 **/
@Route(path = OpenGLPath.OPENGL_RENDER_CUBE_MAP)
class OpenGLCubeMapActivity:BaseActivity<ActivityOpenglRenderCircleBinding>() {
    override fun getLayoutId(): Int  = R.layout.activity_opengl_render_circle

    override fun initView() {
        mBinding.glSurface.run {
            setEGLContextClientVersion(2)
            //setRenderer(MyCubeRender(this@OpenGLCubeMapActivity))
           setRenderer(TriangleRender().apply {
               addDrawerRender(CubeMapDrawer())
           })

        }
    }

    override fun onResume() {
        super.onResume()
        mBinding.glSurface.onResume()
    }

    override fun onPause() {
        super.onPause()
        mBinding.glSurface.onPause()
    }

    override fun initListener() {

    }
}